<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <title>回调函数</title>
    <meta name='viewport' content='width=device-width, initial-scale=1'>
    <link rel='stylesheet' type='text/css' media='screen' href='main.css'>
    <script src='main.js'></script>
</head>
<body>
    
</body>
<script>
    function a (fn){
        setTimeout(() => {
            sum =10
            fn(sum)
        }, 1000);
        a((arr)=>{
            console.log(arr)
        })
        function b(arr){
            console.log(arr)
        }
        a(b)
    }
</script>
</html>